<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>冒泡算法演示</title>
</head>

<body>
    <label for="">请输入一组数字，每个数字之间用英文的“;”分开</label><input type="text" name="" id="numbsers">
    <button id="sort">开始排序</button>
    <script>
        document.getElementById('sort').addEventListener('click', function () {
            formatArray=new Array()
            splited=document.getElementById('numbsers').value.split(';')
            for(let i=0;i<splited.length;i++){
                formatNum=parseInt(splited[i])
                console.log(formatNum)
                if(!Number.isFinite(formatNum)){
                    alert('你输入的内容不合法')
                    return
                }
                formatArray.push(formatNum)
            }
            alert('别傻了，我不会😠')
            //for(let i=0;i<formatArray.length-1;i++){}
        })
    </script>

</html>